<?php
#这个文件用来加载Include,Config,Library目录常量
$settingsFile = __DIR__ . '/.settings.php';

$commonConstNames = array('COMMON_INCLUDE_DIR', 'LIB_DIR');
if(false == file_exists($settingsFile)) {
    die("在项目中创建'.settings.php'文件(该文件不要添加到版本库)，并定义以下常量：" . implode(',', $commonConstNames) . "\n");
}
require($settingsFile);

foreach ($commonConstNames as $constName) {
    if(false == defined($constName)) {
        die('运行必须常量"' . $constName . '"没有定义，请在.settings.php文件中定义！' . PHP_EOL);
    }
}


defined('APP_CONFIG_FILE') || define('APP_CONFIG_FILE', __DIR__ . '/config.php');
require(LIB_DIR . '/Config/initialize.php');
\MicroService\Config::setUConfDir(LIB_DIR . '/Config/UserConfig');


#把服务注册类的命名空间注册到composer中
$classLoader->addPsr4('Registers\\', __DIR__ . '/Registers');
